Add a sort order for the returned data
Parent Type: LearningStoreQuery
Namespace: Microsoft.LearningComponents.Storage
Assembly: Microsoft.LearningComponents.Storage.dll
| C# |
|
public void AddSort ( ) |
columnName
Name of the column to be sorted on. This must refer to a non-XML, non-Guid column.
direction
Direction for the sort.
| Exception type | Condition |
| ArgumentNullException | columnName is a null reference. |
| ArgumentOutOfRangeException | direction is invalid. |
| InvalidOperationException | The column was not found or is not sortable |
The following code creates a new query that returns the names of all the users in the system sorted by name:
| C# |
LearningStoreQuery query = store.CreateQuery("UserItemView");
query.AddColumn("Name");
query.AddSort("Name", LearningStoreSortDirection.Ascending);
|